<template>
  <div class="not-found-container">
    <!-- 背景装饰元素 -->
    <div class="bg-decoration"></div>

    <!-- 404 主内容区 -->
    <div class="content">
      <!-- 数字动画 -->
      <div class="number-container">
        <span class="number">4</span>
        <div class="error-icon">0</div>
        <span class="number">4</span>
      </div>

      <!-- 文字信息 -->
      <h1 class="title">页面不存在</h1>
      <p class="subtitle">抱歉，您访问的页面可能已被删除或暂时不可用</p>

      <!-- 返回按钮 -->
      <button class="back-button" @click="$router.push('/')">返回首页</button>
    </div>
  </div>
</template>

<script>
export default {
  name: '404'
  // 可以添加页面进入时的动画效果
}
</script>

<style scoped>
/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.not-found-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #f8fafc;
  position: relative;
  overflow: hidden;
}

/* 背景装饰 */
.bg-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(34, 211, 238, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.1) 0%, transparent 40%);
}

/* 内容区 */
.content {
  text-align: center;
  z-index: 1;
  padding: 30px; /* 替换2rem为30px */
  border-radius: 16px; /* 替换1rem为16px */
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
  max-width: 90%;
  width: 500px;
}

/* 数字样式 */
.number-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px; /* 替换1rem为16px */
  margin-bottom: 30px; /* 替换2rem为30px */
}

.number {
  font-size: 10vw; /* 使用vw实现响应式字体（最大120px） */
  font-weight: 900;
  max-font-size: 120px; /* 限制最大尺寸 */
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  animation: float 3s ease-in-out infinite;
}

.number:first-child {
  animation-delay: 0s;
}

.number:last-child {
  animation-delay: 0.5s;
}

/* 错误图标 */
.error-icon {
  font-size: 10vw; /* 响应式字体 */
  max-font-size: 120px; /* 限制最大尺寸 */
  color: #f59e0b;
  animation: pulse 2s ease-in-out infinite;
}

/* 标题和副标题 */
.title {
  font-size: 32px; /* 替换2rem为32px */
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0; /* 替换1rem为16px */
  animation: fadeIn 0.8s ease-out forwards;
}

.subtitle {
  font-size: 18px; /* 替换1.1rem为18px */
  color: #64748b;
  margin: 0 0 40px 0; /* 替换2.5rem为40px */
  line-height: 1.6;
  animation: fadeIn 0.8s ease-out 0.2s forwards;
  opacity: 0;
}

/* 返回按钮 */
.back-button {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: none;
  padding: 12px 32px; /* 替换0.8rem 2rem为12px 32px */
  border-radius: 8px; /* 替换0.5rem为8px */
  font-size: 16px; /* 替换1rem为16px */
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px; /* 替换0.5rem为8px */
  transition: all 0.3s ease;
  animation: fadeIn 0.8s ease-out 0.4s forwards;
  opacity: 0;
}

.back-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.3);
}

.back-button:active {
  transform: translateY(1px);
}

/* 动画效果 */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式调整（小屏幕适配） */
@media (max-width: 640px) {
  .number {
    font-size: 10vw; /* 小屏幕缩小比例 */
    max-font-size: 90px;
  }

  .error-icon {
    font-size: 10vw;
    max-font-size: 90px;
  }

  .title {
    font-size: 24px; /* 替换1.5rem为24px */
  }

  .subtitle {
    font-size: 16px; /* 替换1rem为16px */
  }

  .content {
    padding: 20px; /* 小屏幕减少内边距 */
  }
}
</style>
